package com.sumainfor.zuul.conf;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.zuul.fallback.CustomFallbackProvider;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.context.annotation.Bean;

/**
 * @Author PuaChen
 * @Create 2018-10-26 11:17
 */
@SpringBootConfiguration
public class CustomFallBackConfiguration {

    @Bean(value = "TANGNEST-PC-EPC")
    public CustomFallbackProvider pcEpcFallBack() {
        String json = JsonResult.error("PC端工程部服务器异常").toJson();
        return new CustomFallbackProvider("TANGNEST-PC-EPC", json);
    }

    @Bean(value = "TANGNEST-PC-MARKET")
    public CustomFallbackProvider pcMarketFallBack() {
        String json = JsonResult.error("PC端市场部服务器异常").toJson();
        return new CustomFallbackProvider("TANGNEST-PC-MARKET", json);
    }

    @Bean(value = "TANGNEST-PC-CFO")
    public CustomFallbackProvider pcCfoFallBack() {
        String json = JsonResult.error("PC端财务部服务器异常").toJson();
        return new CustomFallbackProvider("TANGNEST-PC-CFO", json);
    }

    @Bean(value = "TANGNEST-PC-GMIO")
    public CustomFallbackProvider pcGmioFallBack() {
        String json = JsonResult.error("PC端运营部服务器异常").toJson();
        return new CustomFallbackProvider("TANGNEST-PC-GMIO", json);
    }

    @Bean(value = "TANGNEST-WX-TENANT")
    public CustomFallbackProvider weChatTenantFallBack() {
        String json = JsonResult.error("微信租客端服务器异常").toJson();
        return new CustomFallbackProvider("TANGNEST-WX-TENANT", json);
    }

    @Bean(value = "TANGNEST-SCHEDULE")
    public CustomFallbackProvider scheduleFallBack() {
        String json = JsonResult.error("定时任务服务器异常").toJson();
        return new CustomFallbackProvider("TANGNEST-SCHEDULE", json);
    }

    @Bean(value = "TANGNEST-PC-DEV")
    public CustomFallbackProvider pcDevFallBack() {
        String json = JsonResult.error("PC发展部服务器异常").toJson();
        return new CustomFallbackProvider("TANGNEST-PC-DEV", json);
    }

    @Bean(value = "TANGNEST-WX-SYSTEM")
    public CustomFallbackProvider wxSystemFallBack() {
        String json = JsonResult.error("微信端后台管理服务器异常").toJson();
        return new CustomFallbackProvider("TANGNEST-WX-SYSTEM", json);
    }
}
